package ovm.management;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by IntelliJ IDEA.
 * User: Jokser
 * Date: 28.05.12
 * Time: 12:21
 * To change this template use File | Settings | File Templates.
 */

@Deprecated
public class EntityFormManager {

    private static Map<String, Object[]> tableProperties = createTableProperties();
    private static Map<String, Object[]> formProperties = createFormProperties();
    
    private static Map<String, Object[]> createTableProperties () {
        Map<String, Object []> map = new HashMap<String, Object[]>();
        // Put table properties here
        map.put("EmployeeEntity", new Object [] {"lastName", "firstName",
                "middleName", "jobByJob", "address", "homePhone", "mobilePhone", "details"});

        map.put("UsersEntity", new Object[] {"login", "password", "rule", "change", "delete"});
        return map;
    }

    private static Map<String, Object[]> createFormProperties () {
        Map<String, Object []> map = new HashMap<String, Object[]>();
        // Put form properties here
        map.put("EmployeeEntity", new Object [] {"lastName", "firstName",
                "middleName", "jobByJob", "address", "homePhone", "mobilePhone"});
        return map;
    }

    public static Object [] getDefaultTableProperties (Class entityClass) {
        String entityClassName = entityClass.getSimpleName();
        return tableProperties.get(entityClassName);
    }

    public static Object [] getDefaultFormProperties (Class entityClass) {
        String entityClassName = entityClass.getSimpleName();
        return formProperties.get(entityClassName);
    }

    public static Object [] getDefaultCatalogTableProperties () {
        return new Object[] {"id", "value"};
    }

}
